<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Halaman Videoku Culture-vid</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
	<link href="<?php echo base_url()?>asset/css/bootstrap.css" rel="stylesheet">
    <link rel="shortcut icon" href="/favicon.ico">
	<link href="<?php echo base_url()?>asset/css/style.css" rel="stylesheet">
	<style>
	@media (min-width: 768px) {
		.buka1 {
			 visibility: hidden;
		}
	}
	</style>
</head>
<body>
	
	<!-- DATA LOADED -->
		<?php 
			$login = $this->session->userdata('isLogin');
			$user = $this->session->userdata('username'); 
			$peran = $this->session->userdata('peran');
		?>
	<!-- DATA LOADED -->
	
	<div class="container-fluid">  
		    <div class="row-fluid">  
				<div class="col-lg-12" id="header">  
					<a href="<?php echo base_url()?>index.php"><img src="<?php echo base_url()?>asset/img/logo.png" style="width: 300px; height: 120px; align:center; display: inline; margin: 0px 0 50px 20px"/></img></a>
					<h3 style="margin: -79px 0 20px 90px; font-family: Georgia; font-size: 30px"></h3> <br>
					<small style="font-family: Times New Roman; font-size: 17px; margin: -40px 0 0 90px; display: inline; position: absolute"></small>
					<span style="margin-top: -15px; margin-right:10px; font-family: tahoma; font-size:18px;" class="pull-right span3">
					
					<?php if(!$login) { ?>
					<button class="btn btn-primary" data-toggle="modal" data-target="#modal_login"><span class="glyphicon glyphicon-log-in"></span> Masuk</button>
				| <a href="<?php echo base_url()?>index.php/akun/daftar" class="btn btn-success" role="button"><span class="glyphicon glyphicon-list-alt"></span> Daftar</a>
					<?php } else { if($peran == 0) { ?> <a href="<?php echo base_url()?>index.php/admin" class="btn btn-primary" role="button">Administrator</a> | <?php } ?> <a href="<?php echo base_url()?>index.php/akun/keluar_akun" class="btn btn-danger" role="button"><span class="glyphicon glyphicon-log-out"></span> Keluar</a> <?php } ?>
					</span>
					
				</div>  
			</div> 
			<div class="row-fluid" >
				<div class="col-lg-12" id="navbar" >
					<form class="navbar-form navbar-right" style="margin-top:10px; margin-right:0px; margin-left:1px;" role="search" action="<?php echo base_url()?>index.php/video/cari_video" method="post">
					
						  <div class="form-group ">
							<input type="text" class="form-control" placeholder="cari video disini..." name="cari">
						  </div>
						  <button type="submit" class="btn btn-danger " ><span class="glyphicon glyphicon-search "></span></button>
					</form>
				</div>  
			</div>
		
	<div class="container-fluid">  
		<div class="row-fluid">  
			<div class="col-lg-2 " style="" id="left-content">  
			<div class="row-fluid">  
			<?php $user = $this->session->userdata('username'); ?>
			<?php if($user != NULL):?>
		   <?php if($this->session->userdata('peran')!= 0) {?>
					  <div class="col-lg-12" id="sidebar-widget">
							<ul class="nav nav-list">
							  <li class="nav-header" style=""><?php echo $user; ?></li>
								<li><a href="<?php if($this->session->userdata('peran') != 1 ) {
								echo base_url();?>index.php/akun" <?php } else { echo base_url();?>index.php/admin" <?php } ?>class="glyphicon glyphicon-user">  Profilku</a></li>
								<?php if($this->session->userdata('peran') != 1 ){ ?>
								<?php if($this->session->userdata('status') == 1) { ?>
									<li><a href="<?php echo base_url()?>index.php/video/" class="glyphicon glyphicon-upload">  Unggah</a></li> 
									<li class="active"><a href="<?php echo base_url()?>index.php/video/videoku" class="glyphicon glyphicon-film"  data-toggle="collapse" data-target=".hisCollapse" style="">  Videoku</a></li>
									<?php } else { ?>
										<li class="disabled"><a class="glyphicon glyphicon-upload">  Unggah</a></li> 
										<li class="disabled"><a class="glyphicon glyphicon-film">  Videoku</a></li> 
									<?php } ?>
								<?php } ?>
							</ul>
							<br>
						</div> 
						<?php } ?>
			<?php endif;?>
					
					<div class="col-lg-12" id="sidebar-widget" style="margin-top:20px;"> 
						<ul class="nav nav-list">
						  <li class="nav-header" data-toggle="collapse" data-target=".navCollapse" style="">Kategori <span class="glyphicon glyphicon-align-justify pull-right"></span></li>
						   <ul class="nav nav-list collapse in navCollapse">
								<?php foreach($kategori as $row) {?>
									<li><a href="<?php echo base_url();?>index.php/video/cari_video_sesuai_kategori/<?php echo $row->id_kategori;?>"><?php echo $row->nama_kategori;?></a></li>  
								<?php } ?>
							</ul>
						</ul>
					</div>   
					
					<?php if(count($histori_video) > 0 ) {?>
					<div class="col-md-12" id="sidebar-widget" style="margin-top:20px;"> 
					<ul class="nav nav-list">
					  <li class="nav-header" data-toggle="collapse" data-target=".hisCollapse" style="">Histori Video<span class="glyphicon glyphicon-align-justify pull-right"></span></li>
					   <ul class="nav nav-list collapse in hisCollapse">
							<?php foreach($histori_video as $row) {?>
								<li><a href="<?php echo base_url();?>index.php/video/lihat_video/<?php echo $row->id_video;?>"><?php echo $row->judul_video;?></a></li>  
							<?php } ?>
						</ul>
						</ul>
					</div>
					<?php } ?>
					
				 </div>  
			 
			</div>  
			<br>
			   	   
		<div class="col-lg-8">  
			<div class="container-fluid">
				 <!-- video terbaru -->
				<legend>Koleksi Videoku</legend>
					<?php if(count($videoku) > 0 ) {?> 
							<?php foreach($videoku as $row) {?>
							<div class="col-lg-12"> 
								<div class="col-lg-3 col-lg-6">
									<a class="thumbnail" href="<?php echo base_url();?>index.php/video/lihat_video/<?php echo $row->id_video;?>"><img style="height:100px; width:100%;" src="<?php echo base_url();?>upload/image/<?php echo $row->gambar_video;?>" alt=""></a>
								</div> 
								<div class="col-lg-6">
									<p><a href="<?php echo base_url();?>index.php/video/lihat_video/<?php echo $row->id_video;?>"><?php echo $row->judul_video;?></a></p>
									<p><?php echo $row->info_singkat;?></p>
								</div>
							</div>
							<?php } ?>
						
					</div>
					<?php } else { ?>
					<h3> --- Kosong --- </h3>
					<?php } ?>
				  <!-- end -->
			 </div>
		</div>
		
			<div class="col-lg-2"  style="margin-top:10px;">
				<ul class="nav nav-list">
					<li class="nav-header" data-toggle="collapse" data-target=".navHeaderCollapse" style="">Asal Daerah <span class="glyphicon glyphicon-align-justify pull-right"></span></li>
					   <ul class="nav nav-list collapse navHeaderCollapse">
							<?php foreach($daerah as $row) {?>
								<li><a href="<?php echo base_url();?>index.php/video/cari_video_sesuai_kategori/<?php echo $row->id_kategori;?>"><?php echo $row->nama_kategori;?></a></li>  
							<?php } ?> 
						</ul>
				</ul>
			</div>
		
		
		
		
	   </div>  
	  
	  
	  
	  
	   <!--S : Footer-->  
	  
	   <div class="row-fluid">  
		<div class="col-lg-12" id="footer"> <p class = "footer-text"> Copyright 2014 </p> 
		</div>  
	   </div>  
	  
	   <!--E : Footer-->  
	  </div>
	</div>
							
		
    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
	<script src="<?php echo base_url()?>asset/js/jquery.js"></script>
    <script src="<?php echo base_url()?>asset/js/bootstrap.js"></script>
	
</body>
</html>